package chapter5.section5;

//程序5-13： 一个使用工厂方法的示例程序

import java.text.NumberFormat;
import java.util.Locale;

public class FactoryDemo {
    public static void main(String[] args) {
        NumberFormat cF = NumberFormat.getCurrencyInstance(Locale.US);
        NumberFormat pF = NumberFormat.getPercentInstance();
        double x = 0.35;
        System.out.println(cF.format(x));
        System.out.println(pF.format(x));
    }
}